package com.mybaitis_plus;

import cn.hutool.core.util.NumberUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.mybaitis_plus.pojo.User;
import org.junit.jupiter.api.Test;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Demo {
    @Test
    public void demo1(){
        User user2 = new User();
        user2.setId(2l);
        user2.setName("huahua");
        user2.setAge(20);
        User user = new User();
        user.setAge(15);
        user.setName("lisan");
        user.setId(1l);
        List<User> userList = new ArrayList<>();
        userList.add(user);
        userList.add(user2);
        List<User> userList2 = new ArrayList<>();
        for (User user1 : userList){
            String userJson = JSON.toJSONString(user1);
            JSONObject jsonObject1 = JSON.parseObject(userJson);
            jsonObject1.remove("name");
            User newUser = jsonObject1.toJavaObject(User.class);
            userList2.add(newUser);
        }
        System.out.println(JSON.toJSON(userList2));
    }

    @Test
    public void demo2(){
        Map<String, String> hm = new HashMap<String, String>();
        hm.put("a", "1");
        hm.put("b", "2");

        // 1. keySet
        for (String key : hm.keySet()) {
            System.out.println(key + ": " + hm.get(key));
        }
        System.out.println("-----------");

        // 2. entrySet
        for (Map.Entry<String, String> entry : hm.entrySet()) {
            System.out.println(entry.getKey() + ": " + entry.getValue());
        }
        System.out.println("-----------");

        // 3. forEach
        hm.forEach((key, value) -> {
            System.out.println(key + ": " + value);
        });
    }

    @Test
    public void demo3(){
        String str = "{\"message\":{\"@type\":\"com.paas.bocloud.common.exception.BocloudException\",\"code\":200206,\"localizedMessage\":\"调用【grpcResponseCheck grpc】服务出错，错误信息：httpbin.zs-mesh 未匹配到工作负载\",\"message\":\"调用【grpcResponseCheck grpc】服务出错，错误信息：httpbin.zs-mesh 未匹配到工作负载\",\"stackTrace\":[{\"className\":\"com.paas.boms.mesh.core.util.GrpcUtil\",\"fileName\":\"GrpcUtil.java\",\"lineNumber\":47,\"methodName\":\"grpcResponseCheck\",\"nativeMethod\":false},{\"className\":\"com.paas.boms.mesh.core.grpc.HeaderClientInterceptor$1$1\",\"fileName\":\"HeaderClientInterceptor.java\",\"lineNumber\":57,\"methodName\":\"onMessage\",\"nativeMethod\":false},{\"className\":\"io.grpc.ForwardingClientCallListener\",\"fileName\":\"ForwardingClientCallListener.java\",\"lineNumber\":33,\"methodName\":\"onMessage\",\"nativeMethod\":false},{\"className\":\"io.grpc.ForwardingClientCallListener\",\"fileName\":\"ForwardingClientCallListener.java\",\"lineNumber\":33,\"methodName\":\"onMessage\",\"nativeMethod\":false},{\"className\":\"io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1MessagesAvailable\",\"fileName\":\"ClientCallImpl.java\",\"lineNumber\":599,\"methodName\":\"runInternal\",\"nativeMethod\":false},{\"className\":\"io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1MessagesAvailable\",\"fileName\":\"ClientCallImpl.java\",\"lineNumber\":584,\"methodName\":\"runInContext\",\"nativeMethod\":false},{\"className\":\"io.grpc.internal.ContextRunnable\",\"fileName\":\"ContextRunnable.java\",\"lineNumber\":37,\"methodName\":\"run\",\"nativeMethod\":false},{\"className\":\"io.grpc.internal.SerializingExecutor\",\"fileName\":\"SerializingExecutor.java\",\"lineNumber\":123,\"methodName\":\"run\",\"nativeMethod\":false},{\"className\":\"io.grpc.stub.ClientCalls$ThreadlessExecutor\",\"fileName\":\"ClientCalls.java\",\"lineNumber\":669,\"methodName\":\"waitAndDrain\",\"nativeMethod\":false},{\"className\":\"io.grpc.stub.ClientCalls\",\"fileName\":\"ClientCalls.java\",\"lineNumber\":132,\"methodName\":\"blockingUnaryCall\",\"nativeMethod\":false},{\"className\":\"com.paas.boms.mesh.core.proto.VirtualServiceGrpcServerGrpc$VirtualServiceGrpcServerBlockingStub\",\"fileName\":\"VirtualServiceGrpcServerGrpc.java\",\"lineNumber\":539,\"methodName\":\"updateByVirtualService\",\"nativeMethod\":false},{\"className\":\"com.paas.boms.mesh.core.service.impl.VirtualServiceImpl\",\"fileName\":\"VirtualServiceImpl.java\",\"lineNumber\":67,\"methodName\":\"lambda$operatorVirtualService$3\",\"nativeMethod\":false},{\"className\":\"com.paas.boms.mesh.core.grpc.exception.GrpcExceptionWrapper\",\"fileName\":\"GrpcExceptionWrapper.java\",\"lineNumber\":20,\"methodName\":\"wrapper\",\"nativeMethod\":false},{\"className\":\"com.paas.boms.mesh.core.service.impl.VirtualServiceImpl\",\"fileName\":\"VirtualServiceImpl.java\",\"lineNumber\":67,\"methodName\":\"operatorVirtualService\",\"nativeMethod\":false},{\"className\":\"com.paas.boms.mesh.client.govern.service.strategy.TrafficRouteStrategy\",\"fileName\":\"TrafficRouteStrategy.java\",\"lineNumber\":216,\"methodName\":\"innerExecCallForVs\",\"nativeMethod\":false},{\"className\":\"com.paas.boms.mesh.client.govern.service.strategy.TrafficRouteStrategy\",\"fileName\":\"TrafficRouteStrategy.java\",\"lineNumber\":73,\"methodName\":\"innerExecCall\",\"nativeMethod\":false},{\"className\":\"com.paas.boms.mesh.client.govern.service.strategy.AbstractStrategy\",\"fileName\":\"AbstractStrategy.java\",\"lineNumber\":58,\"methodName\":\"sigleCluster\",\"nativeMethod\":false},{\"className\":\"com.paas.boms.mesh.client.govern.service.strategy.TrafficRouteStrategy\",\"fileName\":\"TrafficRouteStrategy.java\",\"lineNumber\":247,\"methodName\":\"execCall\",\"nativeMethod\":false},{\"className\":\"com.paas.boms.mesh.client.govern.service.strategy.TrafficRouteStrategy\",\"fileName\":\"TrafficRouteStrategy.java\",\"lineNumber\":277,\"methodName\":\"create\",\"nativeMethod\":false},{\"className\":\"com.paas.boms.mesh.client.govern.controller.TrafficRouteController\",\"fileName\":\"TrafficRouteController.java\",\"lineNumber\":60,\"methodName\":\"addTrafficRoute\",\"nativeMethod\":false},{\"className\":\"com.paas.boms.mesh.client.govern.controller.TrafficRouteController$$FastClassBySpringCGLIB$$8ac98f7e\",\"fileName\":\"<generated>\",\"lineNumber\":-1,\"methodName\":\"invoke\",\"nativeMethod\":false},{\"className\":\"org.springframework.cglib.proxy.MethodProxy\",\"fileName\":\"MethodProxy.java\",\"lineNumber\":204,\"methodName\":\"invoke\",\"nativeMethod\":false},{\"className\":\"org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation\",\"fileName\":\"CglibAopProxy.java\",\"lineNumber\":746,\"methodName\":\"invokeJoinpoint\",\"nativeMethod\":false},{\"className\":\"org.springframework.aop.framework.ReflectiveMethodInvocation\",\"fileName\":\"ReflectiveMethodInvocation.java\",\"lineNumber\":163,\"methodName\":\"proceed\",\"nativeMethod\":false},{\"className\":\"org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor\",\"fileName\":\"MethodBeforeAdviceInterceptor.java\",\"lineNumber\":56,\"methodName\":\"invoke\",\"nativeMethod\":false},{\"className\":\"org.springframework.aop.framework.ReflectiveMethodInvocation\",\"fileName\":\"ReflectiveMethodInvocation.java\",\"lineNumber\":174,\"methodName\":\"proceed\",\"nativeMethod\":false},{\"className\":\"org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint\",\"fileName\":\"MethodInvocationProceedingJoinPoint.java\",\"lineNumber\":88,\"methodName\":\"proceed\",\"nativeMethod\":false},{\"className\":\"com.bocloud.paas.common.audit.log.LogAspect\",\"fileName\":\"LogAspect.java\",\"lineNumber\":67,\"methodName\":\"doAround\",\"nativeMethod\":false},{\"className\":\"sun.reflect.GeneratedMethodAccessor615\",\"lineNumber\":-1,\"methodName\":\"invoke\",\"nativeMethod\":false},{\"className\":\"sun.reflect.DelegatingMethodAccessorImpl\",\"fileName\":\"DelegatingMethodAccessorImpl.java\",\"lineNumber\":43,\"methodName\":\"invoke\",\"nativeMethod\":false},{\"className\":\"java.lang.reflect.Method\",\"fileName\":\"Method.java\",\"lineNumber\":498,\"methodName\":\"invoke\",\"nativeMethod\":false},{\"className\":\"org.springframework.aop.aspectj.AbstractAspectJAdvice\",\"fileName\":\"AbstractAspectJAdvice.java\",\"lineNumber\":644,\"methodName\":\"invokeAdviceMethodWithGivenArgs\",\"nativeMethod\":false},{\"className\":\"org.springframework.aop.aspectj.AbstractAspectJAdvice\",\"fileName\":\"AbstractAspectJAdvice.java\",\"lineNumber\":633,\"methodName\":\"invokeAdviceMethod\",\"nativeMethod\":false},{\"className\":\"org.springframework.aop.aspectj.AspectJAroundAdvice\",\"fileName\":\"AspectJAroundAdvice.java\",\"lineNumber\":70,\"methodName\":\"invoke\",\"nativeMethod\":false},{\"className\":\"org.springframework.aop.framework.ReflectiveMethodInvocation\",\"fileName\":\"ReflectiveMethodInvocation.java\",\"lineNumber\":174,\"methodName\":\"proceed\",\"nativeMethod\":false},{\"className\":\"org.springframework.aop.aspectj.AspectJAfterAdvice\",\"fileName\":\"AspectJAfterAdvice.java\",\"lineNumber\":47,\"methodName\":\"invoke\",\"nativeMethod\":false},{\"className\":\"org.springframework.aop.framework.ReflectiveMethodInvocation\",\"fileName\":\"ReflectiveMethodInvocation.java\",\"lineNumber\":174,\"methodName\":\"proceed\",\"nativeMethod\":false},{\"className\":\"org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor\",\"fileName\":\"AfterReturningAdviceInterceptor.java\",\"lineNumber\":55,\"methodName\":\"invoke\",\"nativeMethod\":false},{\"className\":\"org.springframework.aop.framework.ReflectiveMethodInvocation\",\"fileName\":\"ReflectiveMethodInvocation.java\",\"lineNumber\":174,\"methodName\":\"proceed\",\"nativeMethod\":false},{\"className\":\"org.springframework.aop.aspectj.AspectJAfterThrowingAdvice\",\"fileName\":\"AspectJAfterThrowingAdvice.java\",\"lineNumber\":62,\"methodName\":\"invoke\",\"nativeMethod\":false},{\"className\":\"org.springframework.aop.framework.ReflectiveMethodInvocation\",\"fileName\":\"ReflectiveMethodInvocation.java\",\"lineNumber\":174,\"methodName\":\"proceed\",\"nativeMethod\":false},{\"className\":\"org.springframework.aop.interceptor.ExposeInvocationInterceptor\",\"fileName\":\"ExposeInvocationInterceptor.java\",\"lineNumber\":92,\"methodName\":\"invoke\",\"nativeMethod\":false},{\"className\":\"org.springframework.aop.framework.ReflectiveMethodInvocation\",\"fileName\":\"ReflectiveMethodInvocation.java\",\"lineNumber\":185,\"methodName\":\"proceed\",\"nativeMethod\":false},{\"className\":\"org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor\",\"fileName\":\"CglibAopProxy.java\",\"lineNumber\":688,\"methodName\":\"intercept\",\"nativeMethod\":false},{\"className\":\"com.paas.boms.mesh.client.govern.controller.TrafficRouteController$$EnhancerBySpringCGLIB$$e7796f27\",\"fileName\":\"<generated>\",\"lineNumber\":-1,\"methodName\":\"addTrafficRoute\",\"nativeMethod\":false},{\"className\":\"sun.reflect.NativeMethodAccessorImpl\",\"fileName\":\"NativeMethodAccessorImpl.java\",\"lineNumber\":-2,\"methodName\":\"invoke0\",\"nativeMethod\":true},{\"className\":\"sun.reflect.NativeMethodAccessorImpl\",\"fileName\":\"NativeMethodAccessorImpl.java\",\"lineNumber\":62,\"methodName\":\"invoke\",\"nativeMethod\":false},{\"className\":\"sun.reflect.DelegatingMethodAccessorImpl\",\"fileName\":\"DelegatingMethodAccessorImpl.java\",\"lineNumber\":43,\"methodName\":\"invoke\",\"nativeMethod\":false},{\"className\":\"java.lang.reflect.Method\",\"fileName\":\"Method.java\",\"lineNumber\":498,\"methodName\":\"invoke\",\"nativeMethod\":false},{\"className\":\"org.springframework.web.method.support.InvocableHandlerMethod\",\"fileName\":\"InvocableHandlerMethod.java\",\"lineNumber\":209,\"methodName\":\"doInvoke\",\"nativeMethod\":false},{\"className\":\"org.springframework.web.method.support.InvocableHandlerMethod\",\"fileName\":\"InvocableHandlerMethod.java\",\"lineNumber\":136,\"methodName\":\"invokeForRequest\",\"nativeMethod\":false},{\"className\":\"org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod\",\"fileName\":\"ServletInvocableHandlerMethod.java\",\"lineNumber\":102,\"methodName\":\"invokeAndHandle\",\"nativeMethod\":false},{\"className\":\"org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter\",\"fileName\":\"RequestMappingHandlerAdapter.java\",\"lineNumber\":891,\"methodName\":\"invokeHandlerMethod\",\"nativeMethod\":false},{\"className\":\"org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter\",\"fileName\":\"RequestMappingHandlerAdapter.java\",\"lineNumber\":797,\"methodName\":\"handleInternal\",\"nativeMethod\":false},{\"className\":\"org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter\",\"fileName\":\"AbstractHandlerMethodAdapter.java\",\"lineNumber\":87,\"methodName\":\"handle\",\"nativeMethod\":false},{\"className\":\"org.springframework.web.servlet.DispatcherServlet\",\"fileName\":\"DispatcherServlet.java\",\"lineNumber\":991,\"methodName\":\"doDispatch\",\"nativeMethod\":false},{\"className\":\"org.springframework.web.servlet.DispatcherServlet\",\"fileName\":\"DispatcherServlet.java\",\"lineNumber\":925,\"methodName\":\"doService\",\"nativeMethod\":false},{\"className\":\"org.springframework.web.servlet.FrameworkServlet\",\"fileName\":\"FrameworkServlet.java\",\"lineNumber\":974,\"methodName\":\"processRequest\",\"nativeMethod\":false},{\"className\":\"org.springframework.web.servlet.FrameworkServlet\",\"fileName\":\"FrameworkServlet.java\",\"lineNumber\":877,\"methodName\":\"doPost\",\"nativeMethod\":false},{\"className\":\"javax.servlet.http.HttpServlet\",\"fileName\":\"HttpServlet.java\",\"lineNumber\":707,\"methodName\":\"service\",\"nativeMethod\":false},{\"className\":\"org.springframework.web.servlet.FrameworkServlet\",\"fileName\":\"FrameworkServlet.java\",\"lineNumber\":851,\"methodName\":\"service\",\"nativeMethod\":false},{\"className\":\"javax.servlet.http.HttpServlet\",\"fileName\":\"HttpServlet.java\",\"lineNumber\":790,\"methodName\":\"service\",\"nativeMethod\":false},{\"className\":\"org.apache.catalina.core.ApplicationFilterChain\",\"fileName\":\"ApplicationFilterChain.java\",\"lineNumber\":231,\"methodName\":\"internalDoFilter\",\"nativeMethod\":false},{\"className\":\"org.apache.catalina.core.ApplicationFilterChain\",\"fileName\":\"ApplicationFilterChain.java\",\"lineNumber\":166,\"methodName\":\"doFilter\",\"nativeMethod\":false},{\"className\":\"org.apache.tomcat.websocket.server.WsFilter\",\"fileName\":\"WsFilter.java\",\"lineNumber\":52,\"methodName\":\"doFilter\",\"nativeMethod\":false},{\"className\":\"org.apache.catalina.core.ApplicationFilterChain\",\"fileName\":\"ApplicationFilterChain.java\",\"lineNumber\":193,\"methodName\":\"internalDoFilter\",\"nativeMethod\":false},{\"className\":\"org.apache.catalina.core.ApplicationFilterChain\",\"fileName\":\"ApplicationFilterChain.java\",\"lineNumber\":166,\"methodName\":\"doFilter\",\"nativeMethod\":false},{\"className\":\"com.alibaba.druid.support.http.WebStatFilter\",\"fileName\":\"WebStatFilter.java\",\"lineNumber\":123,\"methodName\":\"doFilter\",\"nativeMethod\":false},{\"className\":\"org.apache.catalina.core.ApplicationFilterChain\",\"fileName\":\"ApplicationFilterChain.java\",\"lineNumber\":193,\"methodName\":\"internalDoFilter\",\"nativeMethod\":false},{\"className\":\"org.apache.catalina.core.ApplicationFilterChain\",\"fileName\":\"ApplicationFilterChain.java\",\"lineNumber\":166,\"methodName\":\"doFilter\",\"nativeMethod\":false},{\"className\":\"org.springframework.boot.actuate.web.trace.servlet.HttpTraceFilter\",\"fileName\":\"HttpTraceFilter.java\",\"lineNumber\":90,\"methodName\":\"doFilterInternal\",\"nativeMethod\":false},{\"className\":\"org.springframework.web.filter.OncePerRequestFilter\",\"fileName\":\"OncePerRequestFilter.java\",\"lineNumber\":107,\"methodName\":\"doFilter\",\"nativeMethod\":false},{\"className\":\"org.apache.catalina.core.ApplicationFilterChain\",\"fileName\":\"ApplicationFilterChain.java\",\"lineNumber\":193,\"methodName\":\"internalDoFilter\",\"nativeMethod\":false},{\"className\":\"org.apache.catalina.core.ApplicationFilterChain\",\"fileName\":\"ApplicationFilterChain.java\",\"lineNumber\":166,\"methodName\":\"doFilter\",\"nativeMethod\":false},{\"className\":\"org.springframework.web.filter.RequestContextFilter\",\"fileName\":\"RequestContextFilter.java\",\"lineNumber\":99,\"methodName\":\"doFilterInternal\",\"nativeMethod\":false},{\"className\":\"org.springframework.web.filter.OncePerRequestFilter\",\"fileName\":\"OncePerRequestFilter.java\",\"lineNumber\":107,\"methodName\":\"doFilter\",\"nativeMethod\":false},{\"className\":\"org.apache.catalina.core.ApplicationFilterChain\",\"fileName\":\"ApplicationFilterChain.java\",\"lineNumber\":193,\"methodName\":\"internalDoFilter\",\"nativeMethod\":false},{\"className\":\"org.apache.catalina.core.ApplicationFilterChain\",\"fileName\":\"ApplicationFilterChain.java\",\"lineNumber\":166,\"methodName\":\"doFilter\",\"nativeMethod\":false},{\"className\":\"org.springframework.web.filter.HttpPutFormContentFilter\",\"fileName\":\"HttpPutFormContentFilter.java\",\"lineNumber\":109,\"methodName\":\"doFilterInternal\",\"nativeMethod\":false},{\"className\":\"org.springframework.web.filter.OncePerRequestFilter\",\"fileName\":\"OncePerRequestFilter.java\",\"lineNumber\":107,\"methodName\":\"doFilter\",\"nativeMethod\":false},{\"className\":\"org.apache.catalina.core.ApplicationFilterChain\",\"fileName\":\"ApplicationFilterChain.java\",\"lineNumber\":193,\"methodName\":\"internalDoFilter\",\"nativeMethod\":false},{\"className\":\"org.apache.catalina.core.ApplicationFilterChain\",\"fileName\":\"ApplicationFilterChain.java\",\"lineNumber\":166,\"methodName\":\"doFilter\",\"nativeMethod\":false},{\"className\":\"org.springframework.web.filter.HiddenHttpMethodFilter\",\"fileName\":\"HiddenHttpMethodFilter.java\",\"lineNumber\":93,\"methodName\":\"doFilterInternal\",\"nativeMethod\":false},{\"className\":\"org.springframework.web.filter.OncePerRequestFilter\",\"fileName\":\"OncePerRequestFilter.java\",\"lineNumber\":107,\"methodName\":\"doFilter\",\"nativeMethod\":false},{\"className\":\"org.apache.catalina.core.ApplicationFilterChain\",\"fileName\":\"ApplicationFilterChain.java\",\"lineNumber\":193,\"methodName\":\"internalDoFilter\",\"nativeMethod\":false},{\"className\":\"org.apache.catalina.core.ApplicationFilterChain\",\"fileName\":\"ApplicationFilterChain.java\",\"lineNumber\":166,\"methodName\":\"doFilter\",\"nativeMethod\":false},{\"className\":\"org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter\",\"fileName\":\"WebMvcMetricsFilter.java\",\"lineNumber\":155,\"methodName\":\"filterAndRecordMetrics\",\"nativeMethod\":false},{\"className\":\"org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter\",\"fileName\":\"WebMvcMetricsFilter.java\",\"lineNumber\":123,\"methodName\":\"filterAndRecordMetrics\",\"nativeMethod\":false},{\"className\":\"org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter\",\"fileName\":\"WebMvcMetricsFilter.java\",\"lineNumber\":108,\"methodName\":\"doFilterInternal\",\"nativeMethod\":false},{\"className\":\"org.springframework.web.filter.OncePerRequestFilter\",\"fileName\":\"OncePerRequestFilter.java\",\"lineNumber\":107,\"methodName\":\"doFilter\",\"nativeMethod\":false},{\"className\":\"org.apache.catalina.core.ApplicationFilterChain\",\"fileName\":\"ApplicationFilterChain.java\",\"lineNumber\":193,\"methodName\":\"internalDoFilter\",\"nativeMethod\":false},{\"className\":\"org.apache.catalina.core.ApplicationFilterChain\",\"fileName\":\"ApplicationFilterChain.java\",\"lineNumber\":166,\"methodName\":\"doFilter\",\"nativeMethod\":false},{\"className\":\"org.springframework.web.filter.CharacterEncodingFilter\",\"fileName\":\"CharacterEncodingFilter.java\",\"lineNumber\":200,\"methodName\":\"doFilterInternal\",\"nativeMethod\":false},{\"className\":\"org.springframework.web.filter.OncePerRequestFilter\",\"fileName\":\"OncePerRequestFilter.java\",\"lineNumber\":107,\"methodName\":\"doFilter\",\"nativeMethod\":false},{\"className\":\"org.apache.catalina.core.ApplicationFilterChain\",\"fileName\":\"ApplicationFilterChain.java\",\"lineNumber\":193,\"methodName\":\"internalDoFilter\",\"nativeMethod\":false},{\"className\":\"org.apache.catalina.core.ApplicationFilterChain\",\"fileName\":\"ApplicationFilterChain.java\",\"lineNumber\":166,\"methodName\":\"doFilter\",\"nativeMethod\":false},{\"className\":\"org.apache.catalina.core.StandardWrapperValve\",\"fileName\":\"StandardWrapperValve.java\",\"lineNumber\":198,\"methodName\":\"invoke\",\"nativeMethod\":false},{\"className\":\"org.apache.catalina.core.StandardContextValve\",\"fileName\":\"StandardContextValve.java\",\"lineNumber\":96,\"methodName\":\"invoke\",\"nativeMethod\":false},{\"className\":\"org.apache.catalina.authenticator.AuthenticatorBase\",\"fileName\":\"AuthenticatorBase.java\",\"lineNumber\":493,\"methodName\":\"invoke\",\"nativeMethod\":false},{\"className\":\"org.apache.catalina.core.StandardHostValve\",\"fileName\":\"StandardHostValve.java\",\"lineNumber\":140,\"methodName\":\"invoke\",\"nativeMethod\":false},{\"className\":\"org.apache.catalina.valves.ErrorReportValve\",\"fileName\":\"ErrorReportValve.java\",\"lineNumber\":81,\"methodName\":\"invoke\",\"nativeMethod\":false},{\"className\":\"org.apache.catalina.core.StandardEngineValve\",\"fileName\":\"StandardEngineValve.java\",\"lineNumber\":87,\"methodName\":\"invoke\",\"nativeMethod\":false},{\"className\":\"org.apache.catalina.connector.CoyoteAdapter\",\"fileName\":\"CoyoteAdapter.java\",\"lineNumber\":342,\"methodName\":\"service\",\"nativeMethod\":false},{\"className\":\"org.apache.coyote.http11.Http11Processor\",\"fileName\":\"Http11Processor.java\",\"lineNumber\":800,\"methodName\":\"service\",\"nativeMethod\":false},{\"className\":\"org.apache.coyote.AbstractProcessorLight\",\"fileName\":\"AbstractProcessorLight.java\",\"lineNumber\":66,\"methodName\":\"process\",\"nativeMethod\":false},{\"className\":\"org.apache.coyote.AbstractProtocol$ConnectionHandler\",\"fileName\":\"AbstractProtocol.java\",\"lineNumber\":806,\"methodName\":\"process\",\"nativeMethod\":false},{\"className\":\"org.apache.tomcat.util.net.NioEndpoint$SocketProcessor\",\"fileName\":\"NioEndpoint.java\",\"lineNumber\":1498,\"methodName\":\"doRun\",\"nativeMethod\":false},{\"className\":\"org.apache.tomcat.util.net.SocketProcessorBase\",\"fileName\":\"SocketProcessorBase.java\",\"lineNumber\":49,\"methodName\":\"run\",\"nativeMethod\":false},{\"className\":\"java.util.concurrent.ThreadPoolExecutor\",\"fileName\":\"ThreadPoolExecutor.java\",\"lineNumber\":1149,\"methodName\":\"runWorker\",\"nativeMethod\":false},{\"className\":\"java.util.concurrent.ThreadPoolExecutor$Worker\",\"fileName\":\"ThreadPoolExecutor.java\",\"lineNumber\":624,\"methodName\":\"run\",\"nativeMethod\":false},{\"className\":\"org.apache.tomcat.util.threads.TaskThread$WrappingRunnable\",\"fileName\":\"TaskThread.java\",\"lineNumber\":61,\"methodName\":\"run\",\"nativeMethod\":false},{\"className\":\"java.lang.Thread\",\"fileName\":\"Thread.java\",\"lineNumber\":748,\"methodName\":\"run\",\"nativeMethod\":false}]}}";
        int index = str.indexOf("localizedMessage");
        String substring = str.substring(index);
        System.out.println(substring.split("\"")[2]);
    }

    @Test
    public void demo4(){
        String str = "{\"message\":\"删除服务时出现异常：\\n### Error querying database.  Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Result consisted of more than one row\\n### The error may exist in URL [jar:file:/app.jar!/BOOT-INF/lib/boc-application-3.1.2-SNAPSHOT.jar!/mapper/V2ImageGroupMapper.xml]\\n### The error may involve defaultParameterMap\\n### The error occurred while setting parameters\\n### SQL: {call deleteVersionAndImageGroup(         ?,         ?         )}\\n### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Result consisted of more than one row\\n; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Result consisted of more than one row\"}";
        JSONObject dataResponseObject = JSON.parseObject(str);
        if (dataResponseObject.containsKey("stackTrace")){
            dataResponseObject.remove("stackTrace");
        }
        str = JSON.toJSONString(dataResponseObject);
        System.out.println(str);
    }

    @Test
    public void demo5(){
        String str = "{\"message\":\"删除服务时出现异常：\\n### Error querying database.  Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Result consisted of more than one row\\n### The error may exist in URL [jar:file:/app.jar!/BOOT-INF/lib/boc-application-3.1.2-SNAPSHOT.jar!/mapper/V2ImageGroupMapper.xml]\\n### The error may involve defaultParameterMap\\n### The error occurred while setting parameters\\n### SQL: {call deleteVersionAndImageGroup(         ?,         ?         )}\\n### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Result consisted of more than one row\\n; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Result consisted of more than one row\"}";
        System.out.println(str);
        JSONObject responseJSONObject = JSONObject.parseObject(str);
        if (responseJSONObject.containsKey("message")) {
            String messageJson = responseJSONObject.getString("message");
            str = messageJson;
            System.out.println(str);
        }

    }

    @Test
    public void demo06(){
        long id = 123l;
        Object str = id;
        System.out.println(NumberUtil.isNumber(String.valueOf(str)));
    }
}
